!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! SETUP CODE !! Purpose: To set the pod include file and the pod being used, as well as !! relevant setup conditions. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! setup trap active force line no include "6502.pod" POD 6502 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! SUB: Main !! PURPOSE: Start the process. Introduce the program to refresh the !! operator's memory, and enter into the main menu. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program Main declarations !! Short delay to introduce program dpy RETURN OF THE JEDI - JEDI aux RETURN OF THE JEDI - JEDI REG8 = 25 execute DelayTics8 execute MainMenu !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! SUB: MainMenu !! PURPOSE: Give the user options to select from in menu format. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program MainMenu declarations assign REGB to Input MenuLp: Input = 0 aux _ aux _ aux MAIN MENU aux ____1=RAMMenu aux ____2=ROMMenu aux ____3=Run all tests aux _ aux _ aux MENU COMMAND> dpy CMD> 1, 2 or 3 execute GetKey if Input = 1 goto Menu1 !! hooks to RAMMenu if Input = 2 goto Menu2 !! hooks to ROMMenu if Input = 3 goto Menu3 !! Test everything goto MenuLp Menu1: !! RAMMenu execute RAMMenu dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu2: !! ROMMenu execute ROMMenu dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu3: !! All Tests execute ram1 execute ram2 execute ram3 execute ram4 execute ram5 execute ram6 execute ram7 execute rom1 execute rom2 execute rom3 execute rom4 execute rom5 dpy # dpy TESTS DONE aux TESTS DONE execute GetKey goto MenuLp MenuF: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! SUB: RAMMenu !! PURPOSE: Give the user options to select from in menu format. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program RAMMenu declarations assign REGB to Input MenuLp: Input = 0 aux _ aux _ aux RAM MENU aux ____1=RAM1 aux ____2=RAM2 aux ____3=RAM3 aux ____4=RAM4 aux ____5=RAM5 aux ____6=RAM6 aux ____7=RAM7 aux ____E=TEST ALL aux _ aux ____F=RETURN aux _ aux MENU COMMAND> dpy CMD> 1-7,E=ALL,F=UP execute GetKey if Input = 1 goto Menu1 !! hooks to RAM1 if Input = 2 goto Menu2 !! hooks to RAM2 if Input = 3 goto Menu3 !! hooks to RAM3 if Input = 4 goto Menu4 !! hooks to RAM4 if Input = 5 goto Menu5 !! hooks to RAM5 if Input = 6 goto Menu6 !! hooks to RAM6 if Input = 7 goto Menu7 !! hooks to RAM7 if Input = E goto MenuE !! hooks to all tests goto MenuLp Menu1: !! RAM1 execute RAM1 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu2: !! RAM2 execute RAM2 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu3: !! RAM3 execute RAM3 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu4: !! RAM4 execute RAM4 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu5: !! RAM5 execute RAM5 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu6: !! RAM6 execute RAM6 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu7: !! RAM7 execute RAM7 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp MenuE: !! All tests execute RAM1 execute RAM2 execute RAM3 execute RAM4 execute RAM5 execute RAM6 execute RAM7 dpy # dpy TESTS DONE aux TESTS DONE execute GetKey goto MenuLp MenuF: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: RAM1 !! Purpose: Tests one address range in RAM mode. $0-$7FF !! Calculated RAM. Confirm. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program RAM1 dpy RAM test @ 0-7FF IC 14B-C aux RAM test @ 0-7FF IC 14B-C RAM short @ 0-7FF !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: RAM2/3 !! Purpose: Tests one address range in RAM mode. $2000-$27FF !! Calculated RAM. Confirm. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program RAM2 dpy RAM test @ 2000-23FF IC 7M-L aux RAM test @ 2000-23FF IC 7M-L ram short @ 2000-23FF program RAM3 dpy RAM test @ 2400-27FF IC 7N aux RAM test @ 2400-27FF IC 7N REG8 = 2400 REG9 = 2800 execute lowbit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: RAM4/5 !! Purpose: Tests one address range in RAM mode. $2800-$2FFF !! Calculated RAM. Confirm. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program RAM4 dpy RAM test @ 2800-2BFF IC 12P-R aux RAM test @ 2800-2BFF IC 12P-R RAM short @ 2800-2BFF program RAM5 dpy RAM test @ 2C00-2FFF IC 12S aux RAM test @ 2C00-2FFF IC 12S REG8 = 2C00 REG9 = 3000 execute lowbit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: RAM6 !! Purpose: Tests one address range in RAM mode. $3000-$37BF !! Calculated RAM. Confirm. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program RAM6 dpy RAM test @ 3000-37FF IC 2R-S aux RAM test @ 3000-37FF IC 2R-S RAM short @ 3000-37FF program RAM7 dpy RAM test @ 3800-3BFF IC 4K-5K aux RAM test @ 3800-3BFF IC 4K-5K RAM short @ 3800-3BFF !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! SUB: ROMMenu !! PURPOSE: Give the user options to select from in menu format. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program ROMMenu declarations assign REGB to Input MenuLp: Input = 0 aux _ aux _ aux ROM MENU aux ____1=rom1 aux ____2=rom2 aux ____3=rom3 aux ____4=rom4 aux ____5=rom4 aux ____E=TEST ALL aux _ aux ____F=RETURN aux _ aux MENU COMMAND> dpy CMD> 1-5,E=ALL,F=UP execute GetKey if Input = 1 goto Menu1 !! hooks to rom1 if Input = 2 goto Menu2 !! hooks to rom2 if Input = 3 goto Menu3 !! hooks to rom3 if Input = 4 goto Menu4 !! hooks to rom4 if Input = 5 goto Menu5 !! hooks to rom5 if Input = E goto MenuE !! hooks to all tests goto MenuLp Menu1: !! rom1 execute rom1 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu2: !! rom2 execute rom2 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu3: !! rom3 execute rom3 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu4: !! rom4 execute rom4 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp Menu5: !! rom4 execute rom4 dpy # dpy TEST DONE aux TEST DONE execute GetKey goto MenuLp MenuE: !! All tests execute rom1 execute rom2 execute rom3 execute rom4 execute rom5 dpy # dpy TESTS DONE aux TESTS DONE execute GetKey goto MenuLp MenuF: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: rom1 !! Purpose: Tests one ROM. $8000-$BFFF !! Generated ROM test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program rom1 dpy ROM test @ 8000-BFFF IC 14F aux ROM test @ 8000-BFFF IC 14F ROM test @ 8000-BFFF sig 10E7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: rom2 !! Purpose: Tests one ROM. $C000-$FFFF !! Generated ROM test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program rom2 dpy ROM test @ C000-FFFF IC 13F aux ROM test @ C000-FFFF IC 13F ROM test @ C000-FFFF sig FBC8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: rom3 !! Purpose: Tests one ROM. $10000-$13FFF !! Generated ROM test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program rom3 write @ 1f80 = 01 dpy ROM test @ 4000-7FFF IC 13D Pg0 aux ROM test @ 4000-7FFF IC 13D Pg0 ROM test @ 4000-7FFF sig C2FA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: rom4 !! Purpose: Tests one ROM. $14000-$17FFF !! Generated ROM test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program rom4 write @ 1f80 = 02 dpy ROM test @ 4000-7FFF IC 13B Pg1 aux ROM test @ 4000-7FFF IC 13B Pg1 ROM test @ 4000-7FFF sig 3C96 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: rom4 !! Purpose: Tests one ROM. $18000-$1BFFF !! Generated ROM test !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program rom5 write @ 1f80 = 04 dpy ROM test @ 4000-7FFF IC 13A Pg2 aux ROM test @ 4000-7FFF IC 13A Pg2 ROM test @ 4000-7FFF sig 123A !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: KeyEnable !! Purpose: Wait for a key to be pressed !! Inputs: none !! Output: Reg B = 40; toggles the enabling of asynchronous keyboard interrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program KeyEnable REGB = 40 !Initialize reg B dpy-+%B !Enable key interrupt to reg B !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: GetKey !! Purpose: Wait here until a key is pressed !! Inputs: none !! Calls to: KeyEnable !! Outputs: Register B = the value of a key pressed (0-3F) !! Based on program found in the GFI example from Fluke's documentation !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program GetKey execute KeyEnable ! Enable interrupt 1: LABEL 1 if REGB = 40 goto 1 ! Loop till key pressed (<40) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! Program: DelayTics8 !! Purpose: Delays the number of tics specified by REG8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! program DelayTics8 REG1 = REG8 dloop: dec REG1 if REG1 > 0 goto dloop program lowbit !aux Low Test Started REG1 = F0 ! mask REG2 = 0 ! up or down 0 = up, 1 = down REG3 = 0 ! times thru loop REG4 = REG8 ! Store passed start address REG5 = REG9 ! Store passed stop address loopit: REG8 = REG1 ! Store mask to use REG9 = REG4 ! Store address to be tested execute go ! Engage test INC REG4 ! Increment address if REG4 = REG5 goto exitloop ! Test if we've hit the stop address !if REG3 = 2 goto exitloop ! Uncomment to limit runs thru up and down loops (for script testing only) IF REG2 = 0 goto upit ! Are we going up? IF REG2 = 1 goto downit ! Are we going down? upit: INC REG1 ! Increment mask IF REG1 = FF GOTO upREG2 ! If we've hit top of mask range set to go down range next run goto loopit ! back to start loop downit: DEC REG1 ! Decrement mask IF REG1 = F0 GOTO dnREG2 ! If we've hit bottom of mask range set to go up next run goto loopit ! back to start loop upREG2: INC REG2 ! Increment direction indicator register INC REG3 ! Used for limiter - used for testing only GOTO loopit ! back to start loop dnREG2: DEC REG2 ! Decrement direction indicator register INC REG3 ! Used for limiter - used for testing only GOTO loopit ! back to start loop exitloop: ! Return to sender !aux Lowbit Test Complete program go REG1 = REG8 ! Store passed bit mask WRITE @ REG9 = REG8 ! Write bit mask at target address READ @ REG8 ! Read back target address IF REG1 = REG8 goto exitexec ! Compare stored mask with what was read dpy TEST failed $8 @ $9 not REG1 aux TEST failed $8 @ $9 not REG1 stop ! if we hit here there was a problem - halt the program and display error address exitexec: ! Exit routine and display success message on rs232 terminal !aux TEST $8 @ $9 Succesfull ! Uncomment if you want to see progress